<!DOCTYPE html>
<html>
<head>
    <title>口服补液盐</title>
    <meta charset="UTF-8">
    <link rel="stylesheet" href="../css/salt.css"></link>
    <script type="text/javascript">
        function calculate() {
            var weight = document.getElementById('weight').value;
            var height = document.getElementById('height').value;
            var Hct = document.getElementById('Hct').value;

            var y = -24.839 - 0.164 * (weight / (height * height)) + 0.694 * Hct;
            var p = 1 / (1 + Math.exp(-y));

            document.getElementById('result').innerHTML = "p值： " + p.toFixed(3);

            if (p >= 0.472) {
                document.getElementById('treatment').innerHTML = "预测治疗有效，推荐口服补液盐治疗。";
            } else {
                document.getElementById('treatment').innerHTML = "预测治疗无效，不推荐口服补液盐治疗。";
            }
        }
    </script>
</head>
<body>
    <div class="bg">
        <img src="../img/bg2.jpg" style="height: 450px;width: 100%;">
    </div>
    <div class="text">
        <p>口服补液盐治疗儿童血管迷走性晕厥疗效预测</p>
    </div>
    
    <div class="text2">
        <div class="weight-text">
            Weight (kg): &nbsp;&nbsp;<input type="number" id="weight" class="w" any="weight"><br>
        </div>
        <div class="height-text">
            &nbsp;&nbsp;Height (m): &nbsp;&nbsp;<input type="number" id="height" class="h"><br>
        </div>
    <div class="hct-text">
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Hct (%): &nbsp;&nbsp;<input type="number" id="Hct" class="hct"><br>
    </div>
    
    </div>
    <div class="butt">
        <button onclick="calculate()" style="padding: 5px 10px;">提交</button>
        
    </div>

    <div class="r">
        <p id="result" style="text-align: center;"></p><br>    
   
    </div>
    <div class="r-box" id="treatment">
        
    </div>
    
    <div class="box">
        <div class="text3">
            <p>注释：<br>
                Weight：体重，单位：千克。<br>
                Height：身高，单位：米。<br>
                Hct：血细胞比容，单位：%。
            </p>
        </div>
    </div>

    <div class="home">
        <button class="button1"><a style="text-decoration: none;color: black;" href="./index.html">首页</a></button>
    </div>
</body>
</html>


